From 75c72ffef3663223ec023196449bd30020455a9c Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sun, 16 Oct 2005 23:53:29 +0000 Subject: [PATCH] Don't explode in dump text prefetch when we fall off the end of the file :D --- maintenance/backupPrefetch.inc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/maintenance/backupPrefetch.inc b/maintenance/backupPrefetch.inc index ddb0656e0a..759220da04 100644 --- a/maintenance/backupPrefetch.inc +++ b/maintenance/backupPrefetch.inc @@ -92,6 +92,9 @@ class BaseDump { * @access private */ function skipTo( $name ) { + if( $this->atEnd ) { + return false; + } while( $this->reader->read() ) { if( $this->reader->nodeType == XMLREADER_ELEMENT && $this->reader->name == $name ) { @@ -109,6 +112,9 @@ class BaseDump { * @access private */ function nodeContents() { + if( $this->atEnd ) { + return false; + } if( $this->reader->isEmptyElement ) { return ""; } @@ -132,7 +138,6 @@ class BaseDump { */ function close() { $this->reader->close(); - $this->reader = null; $this->atEnd = true; return false; } -- 2.20.1